<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<%@include file="/common/head.jsp" %>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <form  id="detail-form" class="form-horizontal" method="post">

        <div class="form-group">
            <!-- 用户ID -->
            <input type="hidden" id="user-id" name="user.id" value="${n.user.id }" class="form-control">
            <!--  <label class="col-sm-2 control-label">用户ID</label>
            <div class="col-sm-4">

              <input type="text"  placeholder="请选择用户ID" class="form-control"  id="user-name" name="user.username" value="${n.user.id}"
                       onclick="bring({
                               url:'${ctx}/admin/user/search',
                               name: 'username',
                               idInput: 'user-id',
                               nameInput: 'user-name'
                               })" />

            </div>-->
            <p align="center"><font size="5" color="black" face="楷体">基本信息</font></p>

            <label class="col-sm-2 control-label">部门</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="department" value="${n.department.name }" disabled="true">
            </div>


            <!-- 岗位 -->
            <label class="col-sm-2 control-label">岗位</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="position" value="${n.position }" disabled="true">
            </div>



            <!-- 姓名 -->
            <label class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="name" value="${n.name }" readonly="true">
            </div>

            <!-- 出生日期 -->
            <label class="col-sm-2 control-label">出生日期</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="birth"  disabled="true" value="<fmt:formatDate value='${n.birth }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: 'YYYY-MM-DD'})">
            </div>
        </div>
        <div class="form-group">

            <!-- 性别 -->
            <label class="col-sm-2 control-label">性别</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="sex" value="${n.sex == 0 ?"女":n.sex ==1?"男":""}" disabled="true">
            </div>

            <!-- 身高 -->
            <label class="col-sm-2 control-label">身高</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="height" value="${n.height }" disabled="true">
            </div>
        </div>
        <div class="form-group">

            <!-- 体重 -->
            <label class="col-sm-2 control-label">体重</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="weight" value="${n.weight }" disabled="true">
            </div>

            <!-- 籍贯 -->
            <label class="col-sm-2 control-label">籍贯</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="place" value="${n.place }" disabled="true">
            </div>
        </div>
        <div class="form-group">

            <!-- 民族 -->
            <label class="col-sm-2 control-label">民族</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="nation" value="${n.nation }" disabled="true">
            </div>

            <!-- 联系电话 -->
            <label class="col-sm-2 control-label">联系电话</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="phone" value="${n.phone }" disabled="true">
            </div>
        </div>
        <div class="form-group">

            <!-- 身份证号 -->
            <label class="col-sm-2 control-label">身份证号</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="IDCard" value="${n.IDCard }" disabled="true">
            </div>

            <!-- 毕业学校 -->
            <label class="col-sm-2 control-label">毕业学校</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="school" value="${n.school }" disabled="true">
            </div>
        </div>
        <div class="form-group">

            <!-- 专业 -->
            <label class="col-sm-2 control-label">专业</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="major" value="${n.major }" disabled="true">
            </div>

            <!-- 学历 -->
            <label class="col-sm-2 control-label">学历</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="education" value="${n.education ==0?"专科":n.education ==1?"本科":n.education ==2?"硕士":"博士"}" disabled="true">
            </div>
        </div>
        <div class="form-group">

            <!-- 户口所在地 -->
            <label class="col-sm-2 control-label">户口所在地</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="location" value="${n.location }" disabled="true">
            </div>

            <!-- 居住地址 -->
            <label class="col-sm-2 control-label">居住地址</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="address" value="${n.address }" disabled="true">
            </div>
        </div>
        <div class="form-group">

            <!-- 微信号 -->
            <label class="col-sm-2 control-label">微信号</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="wechat" value="${n.wechat }" disabled="true">
            </div>

            <!-- 邮箱 -->
            <label class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="email" value="${n.email }" disabled="true">
            </div>
        </div>
        <div class="form-group">

            <!-- 婚姻状况 -->
            <label class="col-sm-2 control-label">婚姻状况</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="marry" value="${n.marry == 0 ?"未婚":n.marry == 1 ?"已婚":"离异"  }" disabled="true">
            </div>

            <!-- 入职时间 -->
            <label class="col-sm-2 control-label">入职时间</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" name="in_time" disabled="true" value="<fmt:formatDate value='${n.inTime }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: 'YYYY-MM-DD'})">
            </div>
        </div>
        <div class="form-group">

            <!-- 员工状态/1.录用/2.停职 -->
            <%--<label class="col-sm-2 control-label">员工状态/1.录用/2.停职</label>--%>
            <%--<div class="col-sm-4">--%>
            <%--${enum:detail('EmployeeStatus', 'status', n.status)}--%>
            <%--</div>--%>

        </div>

    </form>
</div>

<table id="table" data-toggle="table" data-striped="true" data-click-to-select="true" data-mobile-responsive="true">
    <thead>
    <p align="center"><font size="5" color="black" face="楷体">紧急联系人</font></p>
    <tr>
        <!--<th data-field="_state" data-checkbox="true"></th>
        <th data-field="id" data-visible="false">ID</th>
        <th data-field="employee">员工ID</th>-->
        <th data-field="name">姓名</th>
        <th data-field="relation">关系</th>
        <th data-field="phone">联系电话</th>
        <th data-field="address">单位或住址</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${emergency }" var="em" varStatus="idx">
        <!--<tr data-index="${idx.index }" data-id="${em.emid }">
        <td class="bs-checkbox">
        <input data-index="0" name="btSelectItem" type="checkbox">
        </td>
        <td style="">${em.emid}</td>
        <td style="">${em.employee.name}</td>-->
        <td style="">${em.emname }</td>
        <td style="">${em.relation }</td>
        <td style="">${em.emphone }</td>
        <td style="">${em.emaddress }</td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<table id="table1" data-toggle="table" data-striped="true" data-click-to-select="true" data-mobile-responsive="true">
    <thead>
    <p align="center"><font size="5" color="black" face="楷体">教育及培训情况</font></p>
    <tr>
        <!-- <th data-field="_state" data-checkbox="true"></th>
         <th data-field="id" data-visible="false">ID</th>
         <th data-field="employee">员工ID</th>-->
        <th data-field="start">学习起始时间</th>
        <th data-field="end">学习结束时间</th>
        <th data-field="major">专业</th>
        <th data-field="record">学历</th>
        <th data-field="certificate">证书</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${education }" var="ed" varStatus="idx">
        <!-- <tr data-index="${idx.index }" data-id="${ed.edid }">
        <td class="bs-checkbox">
        <input data-index="0" name="btSelectItem" type="checkbox">
        </td>
        <td style="">${ed.edid }</td>
        <td style="">${ed.employee.name}</td>-->
        <td style="">
            <fmt:formatDate value="${ed.start }" pattern="yyyy-MM-dd"/>
        </td>
        <td style="">
            <fmt:formatDate value="${ed.end }" pattern="yyyy-MM-dd"/>
        </td>
        <td style="">${ed.edmajor }</td>
        <td style="">${ed.record ==0?"专科":ed.record ==1?"本科":ed.record ==2?"硕士":"博士"}</td>

        <td style="">${ed.certificate }</td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<table id="table9" data-toggle="table" data-striped="true" data-click-to-select="true" data-mobile-responsive="true">
    <thead>
    <p align="center"><font size="5" color="black" face="楷体">工作经历</font></p>
    <tr>
        <!--  <th data-field="_state" data-checkbox="true"></th>
          <th data-field="id" data-visible="false">ID</th>
          <th data-field="employee">员工ID</th>-->

        <th data-field="company">单位</th>
        <th data-field="work">工作</th>
        <th data-field="position">职位</th>
        <th data-field="start">工作起始时间</th>
        <th data-field="end">工作结束时间</th>
        <th data-field="reason">离职原因</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${experience }" var="ex" varStatus="idx">
        <!-- <tr data-index="${idx.index }" data-id="${ex.exid }">
        <td class="bs-checkbox">
        <input data-index="0" name="btSelectItem" type="checkbox">
        </td>
        <td style="">${ex.exid }</td>
        <td style="">${ex.employee.name}</td>-->

        <td style="">${ex.company }</td>
        <td style="">${ex.work }</td>
        <td style="">${ex.position1 }</td>
        <td style="">
            <fmt:formatDate value="${ex.exstart }" pattern="yyyy-MM-dd"/>
        </td>
        <td style="">
            <fmt:formatDate value="${ex.exend }" pattern="yyyy-MM-dd"/>
        </td>
        <td style="">${ex.reason }</td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<table id="table10" data-toggle="table" data-striped="true" data-click-to-select="true" data-mobile-responsive="true">
    <thead>
    <p align="center"><font size="5" color="black" face="楷体">家庭成员及主要社会关系</font></p>
    <tr>
        <!-- <th data-field="_state" data-checkbox="true"></th>
         <th data-field="id" data-visible="false">ID</th>
         <th data-field="employee">员工ID</th>-->
        <th data-field="name">姓名</th>
        <th data-field="relation">关系</th>
        <th data-field="contact">联系方式</th>
        <th data-field="age">年龄</th>
        <th data-field="company">工作单位</th>
        <th data-field="position">职位</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${family }" var="fa" varStatus="idx">

        <tr data-index="${idx.index }" data-id="${fa.faid }">
        <td style="display:none;">${fa.faid }</td>
        <td style="">${fa.faname }</td>
        <td style="">${fa.farelation }</td>
        <td style="">${fa.contact }</td>
        <td style="">${fa.age }</td>
        <td style="">${fa.facompany }</td>
        <td style="">${fa.position2 }</td>
        </tr>
    </c:forEach>
    </tbody>
    <tr align="center">
        <td style="" align="right"></td>
    </tr>
</table>
<br><br><br>

<div align="center">
    <p align="center"><font size="5" color="black" face="楷体">身份证照片</font></p>
    <img src="${n.user.idPicture}" width="400" height="400" alt="" >
<%--    <br><br><br>

    <a style="font-size: 20px" href="/admin/user/download">下载附件</a>--%>
</div>

<br><br><br><br><br>

<div>
    <p align="center">
        <button id="update1" type="button" class="btn btn-sm btn-outline btn-info" style="font-size: 15px" onclick="edit()"><i class="fa fa-paste"></i> 修改信息</button>
    </p>
</div>

<script>
    function edit() {
        layer.confirm('确认要修改个人资料吗?', {icon: 3, title:'提示'}, function(index){
            location.href="${ctx}/admin/employee/detail2";
        });
    }
</script>
</body>
</html>